<script setup lang="ts">
import { message } from 'ant-design-vue'
</script>

<template>
    <a @click="() => message.success('成功')">确认</a>
</template>

<style scoped>
a {
    align-items: center;
    justify-content: center;
    display: flex;
    transform: translate(-50%, 50%);
    width: 200px !important;
    height: 60px;
    color: #ffffff;
    font-size: 20px;
    text-decoration: none;
    font-family: sans-serif;
    box-sizing: border-box;
    background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
    background-size: 400%;
    border-radius: 30px;
    z-index: 1;
    cursor: pointer;
}

a:hover {
    animation: animate 8s linear infinite;
}

@keyframes animate {
    from {
        background-position: 0;
    }
    to {
        background-position: 400%;
    }
}

a::before {
    content: '';
    position: absolute;
    inset: -5px;
    z-index: -1;
    background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4) 400%;
    border-radius: 40px;
    opacity: 0;
}

a:hover::before {
    filter: blur(20px);
    animation: animate 8s linear infinite;
}
</style>
